<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!doctype html>
<html lang="zh_CN">
<head>
    <base href="<%=basePath%>"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>欢迎使用后台管理系统</title>
    <link rel="stylesheet" href="plugins/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="plugins/font-awesome/css/font-awesome.min.css">
    <script type="text/javascript" src="plugins/layui/layui.js"></script>
    <script type="text/javascript" src="plugins/layui/controller.js"></script>
    <script type="text/javascript" src="js/jquery-1.3.2.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/article.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/selimage.js" charset="utf-8"></script>
</head>
<body>
<div style="margin: 15px;">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>新增网站内容信息</legend>
    </fieldset>
    <form id="addForm" class="layui-form" action="article/addArticle" name="myform" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label">标题</label>
            <div class="layui-input-inline" style="width: 45%;">
                <input type="text" name="title" class="layui-input" id="title" placeholder="请输入标题"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">栏目</label>
            <div class="layui-input-inline" style="width: 45%;">
                <select name="bannerid" id="bannerid">
                    <option value="">---请选择栏目--</option>
                    <c:forEach items="${bannerList}" var="banner">
                        <option value="${banner.bannerid}">${banner.bannername }</option>
                    </c:forEach></select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">图片</label>
            <div class="layui-input-inline" style="width: 45%;">
                <input class="layui-input" type="text" name="image" id="image" onclick="selimage();" placeholder="请选择图片"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">内容</label>
            <div class="layui-input-inline" style="width: 45%;">
                <script type="text/javascript" src="ckeditor/ckeditor.js"></script>
                <textarea name="contents" id="contents" placeholder="请输入内容"> </textarea>
                <script type="text/javascript">
                    CKEDITOR.replace('contents', {
                        language: 'zh-cn'
                    });
                </script>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" type="submit" id="sub">立即提交</button>
                <button type="reset" class="layui-btn" id="res">取消重置</button>
            </div>
        </div>
    </form>
</div>
</body>
</html>

